package lab02.test01;

public class Address {
    @Override
    public String toString() {
        return country+","+province+","+city+","+street+","+postcode;
    }

    //定义国家、省份、城市、街道、邮编等属性。
    String country;
    String  province;
    String city;
    String street;
    String postcode;

    //构造方法
    public Address() {
    }



    public  Address(String country,String  province,String city,String street,String postcode){

        this.city=city;
        this.country=country;
        this.postcode=postcode;
        this.province=province;
        this.street=street;
    }



    //通过get，set方法获取各属性
    public void setCity(String city) {
        this.city = city;
    }

    public String getCity() {
        return city;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    public String getProvince() {
        return province;
    }

    public void setPostcode(String postcode) {
        this.postcode = postcode;
    }

    public String getPostcode() {
        return postcode;
    }

    public void setStreet(String street) {
        this.street = street;
    }

    public String getStreet() {
        return street;
    }

    public void setCountry(String country) {
        this.country = country;
    }

    public String getCountry() {
        return country;
    }


    //进行输出操作
    public void print(){
        System.out.println("国家："+country);
        System.out.println("省份："+province);
        System.out.println("城市："+city);
        System.out.println("街道："+street);
        System.out.println("邮编："+postcode);
    }

}

